package com.wangxin.study8.completablefuture;

import java.util.concurrent.CompletableFuture;

/**
 * @ClassName ThenCombineTest
 * @Description https://www.jianshu.com/p/6bac52527ca4
 * @Author jojo.wang
 * @Date 2019-05-26 21:19
 * @Version 1.0
 **/
public class ThenCombineTest {
    public static void main(String[] args) {
        CompletableFuture.supplyAsync(()->"hello_")
                .thenApply(s->s+"World_")
                .thenApply(e->e+"wx_")
                .thenApply(String::toUpperCase)
                .thenCombine(CompletableFuture.completedFuture("JAVA"),(s1,s2)->s1+s2)
                .thenAccept(System.out::println);
    }
}
